package com.jpyl.jpMedicalTreatment.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

public class CommonFragmentPagerAdapter extends FragmentPagerAdapter {

	private List<Fragment> fragmentList;

	/**
	 * <b>构造方法。</b>
	 * <p>
	 * <b>详细说明：</b>
	 * </p>
	 * <!-- 在此添加详细说明 --> 无。
	 * 
	 * @param fm
	 */
	public CommonFragmentPagerAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
		this.fragmentList = new ArrayList<Fragment>();
	}

	/**
	 * <b>getItem。</b>
	 * 
	 * @see FragmentPagerAdapter#getItem(int)
	 */
	@Override
	public Fragment getItem(int arg0) {
		// TODO Auto-generated method stub
		return getFragmentList().get(arg0);
	}

	/**
	 * <b>getCount。</b>
	 * 
	 * @see android.support.v4.view.PagerAdapter#getCount()
	 */
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return getFragmentList().size();
	}

	/**
	 * @return the fragmentList
	 */
	public List<Fragment> getFragmentList() {
		return fragmentList;
	}

	/**
	 * @param fragmentList
	 *            the fragmentList to set
	 */
	public void setFragmentList(List<Fragment> fragmentList) {
		this.fragmentList = fragmentList;
	}
}
